using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace MentrixmaxFormularios
{
    public partial class FrReportPai : FrGeralCinzaClaro
    {


        public FrReportPai()
        {
            InitializeComponent();
            dtInicial.Text = DateTime.Now.ToString();
            dtFinal.Text = DateTime.Now.AddDays(1).ToString();

        }

        public  virtual void exeutaRelatorio(){
            System.Diagnostics.Process proc = new System.Diagnostics.Process();
            proc.EnableRaisingEvents = false;
            proc.StartInfo.FileName = "java";
            proc.StartInfo.Arguments = getArgutmentos();
            proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
            proc.Start();
            this.Close();
        }

        protected virtual void btImprimir_Click(object sender, EventArgs e)
        {
            exeutaRelatorio();
        }

        public virtual string getArgutmentos() {
            return "-classpath .;iReport.jar;jasperreports-1.1.1.jar;sqljdbc.jar;commons-beanutils-1.5.jar;commons-collections-2.1.jar;commons-digester-1.7.jar;commons-logging-1.0.2.jar RelatorioCaixa " + dtInicial.Text+" "+dtFinal.Text;
        }

        private void btCancelar_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}